<?php
	include '../init.php';
	include ADMIN_PATH.'/header.php';

	$id=$_GET['id'];
	$model=new Model('user');

	$sql="select 
			u.`username` uname,
			u.`id` 		 uid,
			u.`regtime`  utime,
			ui.`name`    uiname,
			ui.`face`    uiface,
			ui.`sex`     uisex,
			ui.`tel`     uitel,
			ui.`qq`      uiqq,
			ui.`email`   uiemail,
			ui.`birthday` uibirth,
			ui.`age`      uiage,
			ui.`logintime` uitime
			from `user`   u,
			`user_info`   ui
			where u.id=ui.uid and u.id=$id";

	$list=$model->find($sql);
	foreach ($list as $key => $value) 
	{
		$list[$key]['utime']=date('Y年m月d日',$value['utime']);
		$list[$key]['uiname']=$value['uiname']=='xx'?'没有昵称':$value['uiname'];
		$list[$key]['uiface']=$value['uiface'];
		$list[$key]['uibirth']=$value['uibirth']?date('Y年m月d日',$value['uibirth']):'没有生日';
		$list[$key]['uiage']=$value['uiage']?$value['uiage']:'还没有出生';
		$list[$key]['utime']=date('Y年m月d日',$value['utime']);
	}
	$list=$list[0];
?>
<div class="detail_list">
	<h1 style="font:bold 26px/40px 宋体;">用户详情</h1>
	<div class="user_info">
	<ul>
		<li>头像：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php 
			echo $list['uiface']!='no.jpg'?'<img src="'.URL.'/public/uploads/'.substr($list['uiface'], 0,4).'/'.substr($list['uiface'], 4,2).'/'.substr($list['uiface'], 6,2).'/'.$list['uiface'].'">':'<img src="'.URL.'/public/images/no.jpg">';
						?></li>
		<li style="height:30px;line-height:30px;">用户名: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $list['uname'];?></li>
		<li style="height:30px;line-height:30px;">ID: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $list['uid'];?></li>
		<li style="height:30px;line-height:30px;">性别: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			<input type="radio" name="sex" disabled <?php echo $list['uisex']?'checked':'';?>>男 
			<input type="radio" name="sex" disabled <?php echo $list['uisex']?'':'checked';?>>女
		</li>
		<li style="height:30px;line-height:30px;">生日：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $list['uibirth'];?></li>
		<li style="height:30px;line-height:30px;">年龄：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $list['uiage'];?></li>
		<li style="height:30px;line-height:30px;">Tel：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $list['uitel'];?></li>
		<li style="height:30px;line-height:30px;">QQ：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $list['uiqq'];?></li>
		<li style="height:30px;line-height:30px;">Email：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $list['uiemail'];?></li>
		<li style="height:30px;line-height:30px;">昵称：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $list['uiname'];?></li>
		<li style="height:30px;line-height:30px;">注册时间: &nbsp;&nbsp;&nbsp;<?php echo $list['utime'];?></li>
		<li style="height:30px;line-height:30px;">登录时间：&nbsp;<?php echo date('Y年m月d日 H:i:s',$_SESSION['user']['logintime']);?></li>
	</ul>
	</div>
	<div class="clear"></div>
</div>
<?php include ADMIN_PATH.'/footer.html';?>